#!/bin/sh -exu
package="$1"  ; shift
version="$1"  ; shift
root_url="$1" ; shift
brew update
brew tap runtimeverification/k "file://$(pwd)"
brew install $package --build-bottle -v
brew bottle --json $package --root-url="$root_url/v$version/"
cat *.bottle.json
brew bottle --merge --write --no-commit *.bottle.json
cp $(brew formula $package) Formula/$package.rb
